n = 3;
a = [1,3,5; 1.0/3, 1, 1/2; 1/5, 2, 1];
b = prod(a,2);
p = b.^(1/n);
w = p/sum(p);
lmax = sum((a*w)./(w*n));
;
a = 0.3595;
b = 0.1;
c = 0.6105;
d = 0.1;

x1 = (a+b)/(1+b);
x2 = (c-d)/(1-d);
x3 = a/(1-b);
x4 = c/(1+d);

fl = max(1-x1, 1-x2);
fr = max(x3, x4);

